{
  "openapi": "3.0.1",
  "info": {
    "title": "CR - ePlanning to Certifier API",
    "description": "Certificate Register PC API.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/Decline/{CaseID}": {
      "put": {
        "summary": "Decline",
        "description": "This operation transfers the council's decision to decline the Certificate Registration application from the the Online Certificate Registration Service to the certifier's IT system.",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Private Certifier organisation ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Decline"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Case Declined",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CR case not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/ReqAddInfo/{CaseID}": {
      "put": {
        "summary": "ReqAddInfo",
        "description": "This operation transfers the council's request for the certifier to provide additional information from the Online Certificate Registration Service to the certifier's IT system.",
        "operationId": "ReqAddInfo",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Private Certifier organisation ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "body",
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/ReqAddInfo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Request created",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/Register/{CaseID}": {
      "put": {
        "summary": "Register",
        "description": "This operation transfers the council's decision to accept the Certificate Registration from the the Online Certificate Registration Service to the certifier's IT system.",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Private Certifier organisation ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Register"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Certificate registered sucessfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/PaymentAck/{CaseID}": {
      "put": {
        "summary": "PaymentAck",
        "description": "This operation transfers the payment acknowledgement against the Certificate Registration application from the the Online Certificate Registration Service to the certifier's IT system.",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Private Certifier organisation ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentAck"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Payment Acknowledged Successfully",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CR case not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "ReqAddInfo": {
        "required": [
          "requestDetails"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "maxLength": 100,
            "type": "string",
            "description": "Status of the request for additional information",
            "example": "Complete"
          },
          "childCaseID": {
            "type": "string",
            "description": "An AI case id for RFI"
          },
          "requestDate": {
            "type": "string",
            "description": "Date and time of response",
            "format": "date"
          },
          "requestDetails": {
            "maxLength": 512,
            "type": "string",
            "description": "Short description of request",
            "minLength": 1
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          }
        }
      },
      "PaymentAck": {
        "required": [
          "amount",
          "lGAName",
          "payerName",
          "paymentReference",
          "paymentTransDate",
          "transactionReference"
        ],
        "type": "object",
        "properties": {
          "transactionReference": {
            "type": "string",
            "description": "Transaction Reference Number",
            "minLength": 1
          },
          "payerName": {
            "type": "string",
            "description": "Payer Name",
            "minLength": 1
          },
          "lGAName": {
            "type": "string",
            "description": "LGA Name",
            "minLength": 1
          },
          "amount": {
            "type": "number",
            "description": "Amount of payment done"
          },
          "paymentTransDate": {
            "type": "string",
            "description": "Date of Payment",
            "format": "date",
            "minLength": 1
          },
          "paymentReference": {
            "type": "string",
            "description": "Payment case id",
            "example": "P-XXX",
            "minLength": 1
          }
        }
      },
      "Decline": {
        "required": [
          "declineReasons"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "type": "string",
            "description": "Status of the request for additional information",
            "example": "Complete"
          },
          "declineDate": {
            "type": "string",
            "description": "Date of Decline",
            "format": "date"
          },
          "declineReasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeclineReasonList"
            }
          }
        }
      },
      "DeclineReasonList": {
        "required": [
          "declineReason"
        ],
        "type": "object",
        "properties": {
          "declineReason": {
            "type": "string",
            "description": "It infers the decline reason. One of the below mentioned values must be selected for declineReason 1. InComplete 2. Poor Quality 3. In-sufficient Documentation submitted 4. Payment Not Received 5. Other",
            "example": "Refer to description for values",
            "minLength": 1
          },
          "declineReasonDescription": {
            "maxLength": 512,
            "type": "string",
            "description": "required only if 'OTHER' is selected for declineReason"
          }
        }
      },
      "Register": {
        "required": [
          "Declaration",
          "ReferenceNumber",
          "RegistrationDate"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "type": "string",
            "description": "Status of the request for additional information",
            "example": "Complete"
          },
          "ReferenceNumber": {
            "type": "string",
            "description": "Council system Reference Number",
            "minLength": 1
          },
          "Comments": {
            "type": "string",
            "description": "comments or more information"
          },
          "RegistrationDate": {
            "type": "string",
            "description": "Council system Registration Number",
            "format": "date",
            "minLength": 1
          },
          "Declaration": {
            "type": "string",
            "description": "gives consent that certificate details are correct, payment has been received, relevant checks are done and the certificate has been registered in Council's certificate registration system.",
            "minLength": 1
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          }
        }
      },
      "Person": {
        "required": [
          "contactNumber",
          "emailAddress",
          "firstName",
          "surname"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "maxLength": 20,
            "type": "string",
            "example": "John",
            "minLength": 1
          },
          "surname": {
            "maxLength": 20,
            "type": "string",
            "example": "Smith",
            "minLength": 1
          },
          "emailAddress": {
            "maxLength": 250,
            "type": "string",
            "description": "User must be registered in the planning portal",
            "example": "john.smith@gmail.com",
            "minLength": 1
          },
          "contactNumber": {
            "maxLength": 10,
            "minLength": 8,
            "pattern": "^[0-9]+$",
            "type": "string"
          }
        }
      },
      "DownloadableDocument": {
        "type": "object",
        "properties": {
          "documentName": {
            "maxLength": 55,
            "type": "string"
          },
          "documentType": {
            "maxLength": 100,
            "type": "string"
          },
          "uploadedDateTime": {
            "type": "string",
            "format": "date-time"
          },
          "documentURL": {
            "maxLength": 500,
            "type": "string",
            "description": "URL of the document to be downloaded",
            "format": "uri"
          },
          "documentSize": {
            "description": "This indicates the file size of the document in bytes",
            "type": "number"
          },
          "updatedBy": {
            "type": "string",
            "example": "Council"
          }
        }
      },
      "Error": {
        "required": [
          "errorCode",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 404
          },
          "message": {
            "type": "string",
            "example": "Internal Server error 19876"
          },
          "activityId": {
            "type": "string",
            "example": "00000011-0ab-xy00-0000-500000000000"
          },
          "errorCode": {
            "type": "string",
            "example": "DPE_TMS01",
            "minLength": 1
          },
          "errorDetails": {
            "type": "string",
            "example": "Inner Exceptions, Stack Trace, etc"
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "api-key",
        "in": "header"
      }
    }
  }
}